package barrier;

import barrier.Client;

import com.ibm.tspaces.TupleSpace;
import com.ibm.tspaces.TupleSpaceException;

public class Main {

	static final int N_CLIENTS = 4;
	
	public static void main(String [] args)
	{
		TupleSpace ts;
		try {
			
			ts = new TupleSpace("Barrier", "localhost");
			ts.deleteAll();

			boolean init = true;
			int i;
			for(i=0; i < N_CLIENTS; i++)
			{
				new Client(init, "barrier1", ts, N_CLIENTS).start();
				init = false;
			}

		} catch (TupleSpaceException e) {
			e.printStackTrace();
		}
	}
	
}
